From 3df6bc01b6ffcbe1c26170a83e044508e92aab3e Mon Sep 17 00:00:00 2001 From: "josht@us.ibm.com" Date: Wed, 17 Aug 2005 16:50:33 +0000 Subject: [PATCH] Rename vm-top to xentop. Make "xm top" invoke xentop. Make libxenstat a static library, and do not install it. # HG changeset patch # User josht@us.ibm.com # Node ID ea025493dfe39540075ee9e4e75b2146f25bdbd3 # Parent ce557cc4fdc764ac2ce07b8d4bcae77ecf847c29 Rename vm-top to xentop. Make "xm top" invoke xentop. Make libxenstat a static library, and do not install it. --- Config.mk | 5 ++- tools/python/xen/xm/main.py | 7 ++++ tools/xenstat/Makefile | 2 +- tools/xenstat/libxenstat/Makefile | 36 +++++++++++-------- tools/xenstat/{vm-top => xentop}/Makefile | 16 ++++----- tools/xenstat/{vm-top => xentop}/TODO | 3 -- .../{vm-top/vm-top.1 => xentop/xentop.1} | 10 +++--- .../{vm-top/vm-top.c => xentop/xentop.c} | 24 ++++++------- 8 files changed, 55 insertions(+), 48 deletions(-) rename tools/xenstat/{vm-top => xentop}/Makefile (80%) rename tools/xenstat/{vm-top => xentop}/TODO (94%) rename tools/xenstat/{vm-top/vm-top.1 => xentop/xentop.1} (92%) rename tools/xenstat/{vm-top/vm-top.c => xentop/xentop.c} (97%) diff --git a/Config.mk b/Config.mk index 7991af7b2c..14c1f4e7e8 100644 --- a/Config.mk +++ b/Config.mk @@ -14,6 +14,7 @@ LD = $(CROSS_COMPILE)ld CC = $(CROSS_COMPILE)gcc CPP = $(CROSS_COMPILE)gcc -E AR = $(CROSS_COMPILE)ar +RANLIB = $(CROSS_COMPILE)ranlib NM = $(CROSS_COMPILE)nm STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy @@ -37,6 +38,4 @@ CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i)) KERNEL_REPO = http://www.kernel.org # Optional components -XENSTAT_PERL_BINDINGS ?= n -XENSTAT_PYTHON_BINDINGS ?= y -XENSTAT_VM_TOP ?= y +XENSTAT_XENTOP ?= y diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index d1a7fd4f57..f66cc90fa1 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -49,6 +49,7 @@ xm common subcommands: restore create a domain from a saved state file save save domain state (and config) to file shutdown shutdown a domain + top monitor system and domains in real-time unpause unpause a paused domain For a complete list of subcommands run 'xm help --long' @@ -87,6 +88,7 @@ xm full list of subcommands: dmesg [--clear] read or clear Xen's message buffer info get information about the xen host log print the xend log + top monitor system and domains in real-time Scheduler Commands: bvt set BVT scheduler parameters @@ -452,6 +454,9 @@ def xm_console(args): os.execvp('/usr/libexec/xen/xenconsole', cmd.split()) console = sxp.child(info, "console") +def xm_top(args): + os.execv('/usr/sbin/xentop', ['/usr/sbin/xentop']) + def xm_dmesg(args): gopts = Opts(use="""[-c|--clear] @@ -540,6 +545,8 @@ def xm_block_destroy(args): commands = { # console commands "console": xm_console, + # xenstat commands + "top": xm_top, # domain commands "domid": xm_domid, "domname": xm_domname, diff --git a/tools/xenstat/Makefile b/tools/xenstat/Makefile index bb06c4e51e..4caec1a6da 100644 --- a/tools/xenstat/Makefile +++ b/tools/xenstat/Makefile @@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS := SUBDIRS += libxenstat -SUBDIRS += vm-top +SUBDIRS += xentop .PHONY: all install clean diff --git a/tools/xenstat/libxenstat/Makefile b/tools/xenstat/libxenstat/Makefile index d1dee3bd86..27b18523b7 100644 --- a/tools/xenstat/libxenstat/Makefile +++ b/tools/xenstat/libxenstat/Makefile @@ -30,8 +30,9 @@ MAKE_LINK=ln -sf MAJOR=0 MINOR=0 -LIB=src/libxenstat.so.$(MAJOR).$(MINOR) -LINKS=src/libxenstat.so.$(MAJOR) src/libxenstat.so +LIB=src/libxenstat.a +SHLIB=src/libxenstat.so.$(MAJOR).$(MINOR) +SHLIB_LINKS=src/libxenstat.so.$(MAJOR) src/libxenstat.so OBJECTS=src/xenstat.o src/xen-interface.o SONAME_FLAGS=-Wl,-soname -Wl,libxenstat.so.$(MAJOR) @@ -42,9 +43,13 @@ CFLAGS+=-I$(XEN_ROOT)/xen/include/public CFLAGS+=-I$(LINUX_ROOT)/include/asm-xen/linux-public/ LDFLAGS+=-Lsrc -all: $(LIB) $(LINKS) +all: $(LIB) $(LIB): $(OBJECTS) + $(AR) rc $@ $^ + $(RANLIB) $@ + +$(SHLIB): $(OBJECTS) $(CC) $(LDFLAGS) $(SONAME_FLAGS) -shared -o $@ $(OBJECTS) src/xenstat.o: src/xenstat.c src/xenstat.h src/xen-interface.h @@ -59,15 +64,17 @@ src/libxenstat.so.$(MAJOR): $(LIB) src/libxenstat.so: src/libxenstat.so.$(MAJOR) $(MAKE_LINK) $( -#define VM_TOP_VERSION "1.0" +#define XENTOP_VERSION "1.0" -#define VM_TOP_DISCLAIMER \ +#define XENTOP_DISCLAIMER \ "Copyright (C) 2005 International Business Machines Corp\n"\ "This is free software; see the source for copying conditions.There is NO\n"\ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" -#define VM_TOP_BUGSTO "Report bugs to .\n" +#define XENTOP_BUGSTO "Report bugs to .\n" #define _GNU_SOURCE #include @@ -178,7 +178,7 @@ static void usage(const char *program) "-n, --networks output vif network data\n" "-r, --repeat-header repeat table header before each domain\n" "-v, --vcpus output vcpu data\n" - "\n" VM_TOP_BUGSTO, + "\n" XENTOP_BUGSTO, program); return; } @@ -186,9 +186,9 @@ static void usage(const char *program) /* Print program version information */ static void version(void) { - printf("vm-top " VM_TOP_VERSION "\n" + printf("xentop " XENTOP_VERSION "\n" "Written by Judy Fischbach, David Hendricks, Josh Triplett\n" - "\n" VM_TOP_DISCLAIMER); + "\n" XENTOP_DISCLAIMER); } /* Clean up any open resources */ @@ -586,7 +586,7 @@ static void print_ssid(xenstat_domain *domain) } /* Section printing functions */ -/* Prints three line summary header */ +/* Prints the top summary, above the domain table */ void do_summary(void) { #define TIME_STR_LEN 9 @@ -602,7 +602,7 @@ void do_summary(void) strftime(time_str, TIME_STR_LEN, TIME_STR_FORMAT, localtime(&curtime.tv_sec)); num_domains = xenstat_node_num_domains(cur_node); - print("vm-top - %s\n", time_str); + print("xentop - %s\n", time_str); /* Tabulate what states domains are in for summary */ for (i=0; i < num_domains; i++) { @@ -630,7 +630,7 @@ void do_summary(void) xenstat_node_cpu_hz(cur_node)/1000000); } -/* Display top portion of vm-top */ +/* Display the top header for the domain table */ void do_header(void) { field_id i; @@ -651,11 +651,7 @@ void do_header(void) print("\n"); } -/* Displays bottom portion of vm-top, interactive options - * N toggles network information display, V toggles CPU information - * display, S toggles sort order of information (ascending/descending), - * R toggles whether header is repeated for each domain - */ +/* Displays bottom status line or current prompt */ void do_bottom_line(void) { move(lines()-1, 2); -- 2.30.2